Skip to content

Add E2E tests for login, login_with_cert and sudoer functionality#97

Merged
liweinan merged 4 commits intoalchemy-studio:masterfrom
liweinan:add-e2e-test-for-login-functions
Feb 20, 2026
Merged

Add E2E tests for login, login_with_cert and sudoer functionality#97
liweinan merged 4 commits intoalchemy-studio:masterfrom
liweinan:add-e2e-test-for-login-functions

Conversation

@liweinan
Copy link
Contributor

  • Add test dependencies (tower, http-body-util, hyper) to Cargo.toml
  • Create test utilities in htyuc/tests/common/mod.rs
  • Add 20 E2E test cases covering:
    • login_with_password: success, wrong password, missing credentials
    • login_with_cert: invalid signature, missing data
    • sudo/sudo2: auth validation, token verification
    • verify_jwt_token and generate_key_pair endpoints
  • Add Docker Compose config for test PostgreSQL and Redis
  • Add test data initialization SQL fixtures
  • Add test runner script (scripts/run_tests.sh)
  • Update GitHub Actions CI to run E2E tests with services
  • Update README with E2E testing documentation

liweinan and others added 4 commits February 20, 2026 16:03
- Add test dependencies (tower, http-body-util, hyper) to Cargo.toml
- Create test utilities in htyuc/tests/common/mod.rs
- Add 20 E2E test cases covering:
  - login_with_password: success, wrong password, missing credentials
  - login_with_cert: invalid signature, missing data
  - sudo/sudo2: auth validation, token verification
  - verify_jwt_token and generate_key_pair endpoints
- Add Docker Compose config for test PostgreSQL and Redis
- Add test data initialization SQL fixtures
- Add test runner script (scripts/run_tests.sh)
- Update GitHub Actions CI to run E2E tests with services
- Update README with E2E testing documentation

Co-authored-by: Cursor <cursoragent@cursor.com>
- test_sudo2_to_self_after_login: use user_app_info.id instead of hty_id
  (sudo2 endpoint requires user_app_info.id as path parameter)
- test_verify_jwt_token_after_login: add missing HtyHost header

Co-authored-by: Cursor <cursoragent@cursor.com>
The verify_jwt_token endpoint reads token from Authorization header,
not from JSON body. Fixed both test_verify_jwt_token_invalid and
test_verify_jwt_token_after_login tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@liweinan liweinan merged commit 115475d into alchemy-studio:master Feb 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant